<div class="layui-card">
    <div class="layui-breadcrumb" lay-filter="breadcrumb" style="padding: 0 15px;line-height: 50px;">
        <a lay-href="">概览</a>
        <a><cite>设备管理</cite></a>
        <a><cite>产品</cite></a>
    </div>
    <div class="luomi-title" style="margin-top: 10px;">产品管理</div>
</div>

<div class="search">
        <div class="layui-form" lay-filter="Lay-product-search-list">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">产品ID</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" placeholder="请输入ID" name="productCode">
                    </div>
                </div>
                <div class="layui-inline">
                    <label  class="layui-form-label">产品名称</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" placeholder="请输入名称" name="productName">
                    </div>
                </div>
                <input type="button" class="layui-btn" value="搜索" lay-submit lay-filter="Lay-product-serach">
            </div>
        </div>
        
        <div class="layui-form-item">
            <div class="layui-inline">
                <button type="button" class="layui-btn layui-btn-normal add-btn" style="margin-left: 50px;">添加产品</button>
            </div>
        </div>
</div>


  <div class="item" id="item"></div>

  <div id="page" class="page"></div>


  <script type="text/html" id="item-list">
            <div class="layui-fluid">
          <div class="layui-row layui-col-space30">
              {{# layui.each(d,function(index,item) {  }}
                <div class="layui-col-xm1 layui-col-md3 layui-col-sm4" >
                   <div class="layui-card">
                      <div class="layui-card-body">
                        <div class="flex-row">
                            <img src="{{item.image || layui.setter.base + 'style/res/product.png'}}" alt="" width="40" height="40" style="margin: 10px 10px 10px 0;">
                            <div class="flex-col" style="margin-top: 10px;">
                                <div class="name" style="font-weight: 600;">{{item.productName}}</div>
                                <div class="id" style="color: #aaa;">{{item.productCode}}</div>
                            </div>
                        </div>
                         <div class="flex-row around" style="color: #aaa;">
                            <div>设备数量</div>
                            <div>发布状态</div>
                            <div>产品类型</div>
                        </div>
                        <div class="flex-row around">
                            {{# if(item.deviceNum) {  }}
                            <div style="color:cornflowerblue;">{{item.deviceNum}}</div>
                            {{# } else { }}
                            <div>/</div>
                            {{#  } }}

                            {{# if(item.deviceNum > 0){ }}
                            <div>
                                <span class="layui-badge-dot layui-bg-green"></span>已发布
                            </div>
                            {{# }else { }}
                            <div>
                                <span class="layui-badge-dot "></span>未发布
                            </div>
                            {{# } }}

                            <div>/</div>
                        </div>
                     </div>
                     <div class="flex-row" style="background-color: #FAFAFA;justify-content: space-around;height: 50px;align-items: center;">
                        <div class="layui-icon layui-icon-search"></div>
                        <div class="layui-icon layui-icon-edit"></div>
                        <div class="layui-icon layui-icon-delete"></div>
                    </div>
                  
                   </div>
                   
                </div>
                {{# })    }}

          </div>
          
      </div>
  </script>

  <script>
	layui.use(['product'],layui.factory('product')).use(['admin', 'laytpl', 'form', 'laypage','layer', 'view','setter','upload'], function() {
		var $ = layui.$,
			admin = layui.admin,
			table = layui.table,
			laytpl = layui.laytpl,
			element = layui.element,
			form = layui.form,
			laypage = layui.laypage,
			layer = layui.layer,
			view = layui.view,
			setter = layui.setter,
			upload = layui.upload,
			tipsIndex = null;

    });

    </script>